c_ = sparse(20,1);
c_(1) = -1;
b_ = sparse(17,1);
b_(6:6) = b;
b_(12:12) = b;
A_ = sparse(17, 20);
A_(1:1, 4:4) = 1.0; A_(1:1, 10:10) = -1.0;
A_(2:2, 11:11) = a; A_(2:2, 10:10) = -1.0;
A_(3:3, 12:12) = 1.0; A_(3:3, 13:13) = -1.0;
A_(4:4, 4:4) = a; A_(4:4, 13:13) = -1.0;
A_(5:5, 3:3) = 1.0; A_(5:5, 2:2) = 1.0; A_(5:5, 14:14) = -1.0;
A_(6:6, 14:14) = 1.0;
A_(7:7, 15:15) = 1.0; A_(7:7, 5:5) = 1.0; A_(7:7, 14:14) = -1.0;
A_(8:9, 15:15) = 1.0*ones(2, 1); A_(8:9, 16:17) = -1.0*speye(2, 2); A_(8:9, 6:7) = -1.0*speye(2, 2);
A_(10:11, 16:17) = -1.0*speye(2, 2); A_(10:10, 11:11) = 1.0; A_(11:11, 12:12) = 1.0;
A_(12:12, 14:14) = 1.0;
A_(13:14, 1:1) = -1.0*ones(2, 1); A_(13:14, 18:19) = 1.0*speye(2, 2); A_(13:14, 8:9) = -1.0*speye(2, 2);
A_(15:15, 11:11) = 1.0; A_(15:15, 4:4) = -1.0; A_(15:15, 20:20) = -1.0;
A_(16:17, 18:19) = -1.0*speye(2, 2); A_(16:16, 20:20) = 1.0; A_(17:17, 12:12) = 1.0;
G_ = sparse(8, 20);
G_(1:1:1, 2:2) = -speye(1, 1);
G_(2:1:2, 5:5) = -speye(1, 1);
G_(3:1:4, 6:7) = -speye(2, 2);
G_(5:1:6, 8:9) = -speye(2, 2);
G_(7:1:7, 3:3) = -speye(1, 1);
G_(8:1:8, 4:4) = -speye(1, 1);
h_ = zeros(8, 1);
dims.q = [2];
dims.l = 6;
[x_codegen, y_, info_] = ecos(full(c_), G_, h_, dims, A_, full(b_));
t2 = x_codegen(1:1);
t8 = x_codegen(2:2);
t7 = x_codegen(3:3);
x2 = x_codegen(4:4);
t11 = x_codegen(5:5);
t10z0 = x_codegen(6:7);
t2z0 = x_codegen(8:9);
t3 = x_codegen(10:10);
x1 = x_codegen(11:11);
x3 = x_codegen(12:12);
t5 = x_codegen(13:13);
pb = x_codegen(14:14);
t10 = x_codegen(15:15);
t9 = x_codegen(16:17);
t1 = x_codegen(18:19);
t0 = x_codegen(20:20);
ecos_optval = -1*info_.pcost;
